package com.infolab.aims.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

import org.codehaus.jackson.annotate.JsonIgnore;

import com.infolab.aims.common.bean.AbstractModelBean;

@Entity
@Table(name="AMTB_SYSTEM_CODE_VALUE")
@NamedQueries({@NamedQuery(name="SystemCodeValue.findSystemCodeValues",query="select systemCodeValue from SystemCodeValue systemCodeValue where systemCodeValue.systemCodeType.systemCodeTypeCode like :systemCodeTypeCode")})
public class SystemCodeValue extends AbstractModelBean implements Serializable {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer systemCodeValueId;
	
	private String systemCode1;
	private String systemCode2;
	
	private String systemCodeValueDescription;
	
	@JsonIgnore	
	@ManyToOne
	@JoinColumn(name="systemCodeTypeId")
	@NotNull(message="{error.empty}")
	private SystemCodeType systemCodeType;
	
	@Column(columnDefinition="number(1,0) default 1 not null")
	private boolean active;
	
	@ManyToOne
	@JoinColumn(name="accessDepartmentId")
	private Department accessDepartment;

	public String getSystemCode1() {
		return systemCode1;
	}

	public void setSystemCode1(String systemCode1) {
		this.systemCode1 = systemCode1;
	}

	public String getSystemCode2() {
		return systemCode2;
	}

	public void setSystemCode2(String systemCode2) {
		this.systemCode2 = systemCode2;
	}

	public Department getAccessDepartment() {
		return accessDepartment;
	}

	public void setAccessDepartment(Department accessDepartment) {
		this.accessDepartment = accessDepartment;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Integer getSystemCodeValueId() {
		return systemCodeValueId;
	}

	public void setSystemCodeValueId(Integer systemCodeValueId) {
		this.systemCodeValueId = systemCodeValueId;
	}

	@JsonIgnore	
	public SystemCodeType getSystemCodeType() {
		return systemCodeType;
	}

	public void setSystemCodeType(SystemCodeType systemCodeType) {
		this.systemCodeType = systemCodeType;
	}

	public String getSystemCodeValueDescription() {
		return systemCodeValueDescription;
	}

	public void setSystemCodeValueDescription(String systemCodeValueDescription) {
		this.systemCodeValueDescription = systemCodeValueDescription;
	}
	
	
	
}
